Remove cpumask for page_info struct.
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 4 Feb 2009 15:29:51 +0000 (15:29 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 4 Feb 2009 15:29:51 +0000 (15:29 +0000)
This makes TLB flushing on page allocation more conservative, but the
flush clock should still save us most of the time (page freeing and
alloc'ing tends to happen in batches, and not necesasrily close
together). We could add some optimisations to the flush filter if this
does turn out to be a significant overhead for some (useful)
workloads.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/page_alloc.c
xen/include/asm-ia64/mm.h
xen/include/asm-x86/mm.h

index ff3556ed7f5b4c8a7af629d6899e8784b7938a06..de99f7333b22533bb5809268fbd62896f57c8b8c 100644 (file)
@@ -400,7 +400,7 @@ static struct page_info *alloc_heap_pages(
         BUG_ON(pg[i].count_info != 0);
 
         /* Add in any extra CPUs that need flushing because of this page. */
-        cpus_andnot(extra_cpus_mask, pg[i].u.free.cpumask, mask);
+        cpus_andnot(extra_cpus_mask, cpu_online_map, mask);
         tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
         cpus_or(mask, mask, extra_cpus_mask);
 
@@ -425,7 +425,6 @@ static void free_heap_pages(
     unsigned long mask;
     unsigned int i, node = phys_to_nid(page_to_maddr(pg));
     unsigned int zone = page_to_zone(pg);
-    struct domain *d;
 
     ASSERT(order <= MAX_ORDER);
     ASSERT(node >= 0);
@@ -446,15 +445,9 @@ static void free_heap_pages(
          */
         pg[i].count_info = 0;
 
-        if ( (d = page_get_owner(&pg[i])) != NULL )
-        {
-            pg[i].tlbflush_timestamp = tlbflush_current_time();
-            pg[i].u.free.cpumask     = d->domain_dirty_cpumask;
-        }
-        else
-        {
-            cpus_clear(pg[i].u.free.cpumask);
-        }
+        /* If a page has no owner it will need no safety TLB flush. */
+        pg[i].tlbflush_timestamp =
+            page_get_owner(&pg[i]) ? tlbflush_current_time() : 0;
     }
 
     spin_lock(&heap_lock);
index 7337a707cc71d59377ee1938ac7560d992852f51..d28aa565dc0273f08da545457d3ef0084c97dad6 100644 (file)
@@ -62,21 +62,12 @@ struct page_info
         struct {
             /* Order-size of the free chunk this page is the head of. */
             u32 order;
-            /* Mask of possibly-tainted TLBs. */
-            cpumask_t cpumask;
         } free;
 
     } u;
 
     /* Timestamp from 'TLB clock', used to reduce need for safety flushes. */
     u32 tlbflush_timestamp;
-
-#if 0
-// following added for Linux compiling
-    page_flags_t flags;
-    atomic_t _count;
-    struct list_head lru;      // is this the same as above "list"?
-#endif
 };
 
 #define set_page_count(p,v)    atomic_set(&(p)->_count, v - 1)
index 740cc6b58f51671b4d35746f6a1a0b5e33014581..4a8c37f96a0c14a19de4783d2f8107271213fea4 100644 (file)
@@ -66,12 +66,6 @@ struct page_info
             unsigned long count:26; /* Reference count */
         } sh;
 
-        /* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
-        struct {
-            /* Mask of possibly-tainted TLBs. */
-            cpumask_t cpumask;
-        } free;
-
     } u;
 
     union {